home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir24 / aprs60.zip / AUTOWX45.ZIP / ULTILOG.DOC < prev   
Text File  |  1994-08-02  |  7KB  |  170 lines

  1. The data log file is started with a 6 byte header.  The data stream is
  2. read and logged to the log file as follows:
  3.  
  4. The first byte is always F0.
  5.  
  6. Bytes 2 & 3 are the TIME in LSB MSB order.
  7.         The value of these bytes is the half the number of
  8.         seconds since midnite.
  9.  
  10.         Example:
  11.  
  12.         The SAMPLE.LOG (dated 05/21/93) file begins with the bytes:
  13.  
  14.         F0 DC 50 95 2E 05
  15.  
  16.         DC 50 is the time the file begins.  The decimal value of
  17.         50DC is 20700.  20700 / 1800 = 11.5  which indicates the
  18.         file was begun at 11:30 a.m.
  19.  
  20.         Value of MSBLSB / 1800 = Hours since midnite
  21.  
  22.  
  23. Bytes 4 & 5 are the DATE.
  24.         Byte 4 indicates the month and day while byte 5 indicates
  25.         the year.  January begins with 01, February with 21,
  26.         March with 41, and so on.  The first day of the month
  27.         is added so that the 12th day of January would be 0D.
  28.         The 31st day of January would be 1F.  (Don't forget, the
  29.         month begins at 00 which is January 0, not January 1.)
  30.  
  31.         Byte 5 indicates the year.  1994 is 30 until the 9th
  32.         month when 31 is used. 08/01/94 is E1 30 and 09/01/94 is
  33.         01 31.   1995 is 32 & 33, etc.
  34.  
  35.         To convert date to binary representation:
  36.  
  37.                 Yr% = (Year - 1950) + (Year - 1990)
  38.  
  39.                 If Month% > 8 then Month% = 1 : Yr% = Yr% +1
  40.                 Mo% = (Month% * 32) - 32 + day%
  41.  
  42.                 LSB = CHR$(Mo%)
  43.                 MSB = CHR$(Yr%)
  44.  
  45.         To convert binary representation to date:
  46.  
  47.                 da% = VAL("&H" + RIGHT$(LSB$,1))
  48.                 IF Mo% MOD 2 = 1 THEN Day% = Day% + 16
  49.                 Yr% = VAL("&H" + MSB$)
  50.                 Yr% = ((Yr% + 140) / 2) + 1900
  51.  
  52.  
  53. Byte 6 is apparently always 05, presumably because the entries
  54. are made at 5 minute intervals.
  55.  
  56.  
  57. The data from the Ultimeter II weather station is logged
  58. efficiently in log files by ULTIITSR because values are only
  59. recorded if they have not changed since the previous entry.  For
  60. example, if the Wind Direction and Temperature are the same as
  61. the last time they were logged, only the Wind Speed is logged.
  62. The AUTOWX.EXE program, as of version 3.1 uses this same format.
  63. In the SAMPLE.LOG the entries are:
  64.  
  65.                    02 00 02 00 04 00 7B 00
  66.  
  67. These bytes indicate "upper" rainfall amount:  02 00
  68. The next four bytes are the "lower" rainfall:  02 00
  69.  
  70. The next four bytes are:        04  Wind direction
  71.                                 00  Wind speed
  72.                                 7B  Temperature  (LSB)
  73.                                 00  Temperature  (MSB)
  74.  
  75. After the header is written, data is logged in the more efficient format
  76. showing only changes since the last reading.  For example, if only the
  77. temperature changed, the entry would be 10 97 00 where 10 is the
  78. indicator that only a temperature value follows.  97 00 is the
  79. temperature (+56) in LSB MSB order.  Rain amount is represented by 08H,
  80. Wind Direction by 40H, Wind Speed by 20H and Temperature
  81. by 10H.  All other combinations are the result of adding these values.
  82. ie.  Temp change & Wind Speed Change:  10H + 20H = 30H  The values would
  83. then follow 30H;  Wind Speed, 1 byte and Temp 2 bytes (LSB MSB).  Note
  84. that the rain amount and temperature are the only values that use 2
  85. bytes.
  86.  
  87. The original ULTIITSR program uses a value of 80H to indicate when rain
  88. amounts are reset to 0.  AutoWx does not use the same algorithm but
  89. writes a complete new header when rain amounts are reset.  This saves
  90. several lines of code but adds only a couple of bytes to the log file
  91. when the reset is performed.
  92.  
  93. The temperature, as documented by Peet Bros., is the data value
  94. minus 56.  This allows for readings as low as -56F.
  95.  
  96. I have also noticed that the viewer (Ver 1) incorrectly displays the
  97. wind speed.  I don't know if this is due to a bug or to some conversion
  98. that may be going on in the code but, in any case, if you look at the
  99. values recorded in the log file and compare them to those displayed by
  100. the viewer, they don't match.  You can also compare the values displayed
  101. on the U-II and you'll see that they do not match the values recorded in
  102. the log file.  The numbers are also fouled up if you choose other than 5
  103. minute intervals when listing tables.
  104.  
  105. By the way, I use MS-DOS Debug to view and work on log files when
  106. experimenting/snooping around.  If you are not familiar with
  107. DEBUG, be careful.  You can mess up an entire disk.
  108.  
  109. To view a log file, type in DEBUG SAMPLE.LOG at the DOS prompt.
  110. Then, at the minus sign (-), type D and press RETURN.  Repeat to
  111. see more.  Enter "Q" at the - sign to quit and return to DOS.
  112.  
  113. Those familiar with Debug, or those that have other utility
  114. programs, such as a BIN to HEX program can change bytes, etc.  If you
  115. are not familiar with DEBUG don't try doing anything but (D)isplaying
  116. and (Q)uitting files.  Two log files can be appended by using:
  117.  
  118.      COPY /B file1+file2 BIGFILE.LOG 
  119.  
  120. If you have comments or if you develop other U-II software,
  121. please contact me by mail or by packet at N5RKN.#WTX  BBS
  122.  
  123. 73 de Les, N5KOA
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Mon.       1994            00 - No changes                 0000 0000   0
  130. JAN     01 30              08 - Rain                       0000 1000   8
  131. FEB     21 30              10 - Temp                       0001 0000  16
  132. MAR     41 30              18 - Temp & Rain                0001 1000  24
  133. APR     61 30              20 - Speed                      0010 0000  32
  134. MAY     81 30              28 - Speed & Rain               0010 1000  40
  135. JUN     A1 30              30 - Temp & Speed               0011 0000  48
  136. JUL     C1 30              38 - Temp, Speed & Rain         0011 1000  56
  137. AUG     E1 30              40 - Direction                  0100 0000  64
  138.                            48 - Dir & Rain                 0100 1000  72
  139. SEP     01 31              50 - Dir & Temp                 0101 0000  80
  140. OCT     21 31              58 - Dir, Temp & Rain           0101 1000  88
  141. NOV     41 31              60 - Direction & Speed          0110 0000  96
  142. DEC     61 31              68 - Dir, Speed, Rain           0110 1000  104
  143.                            70 - Dir, Speed, & Temp         0111 0000  112
  144.                            78 - Dir, Speed, Temp & Rain    0111 1000  120
  145.  
  146.                            A0 - Time, Date, Rain Reset                128+
  147.                            E0 - Time, Date, Rain Reset                128+
  148.  
  149.  
  150.      N = 10             E = 04          S = 08          W = 0C
  151.    NNE = 01           ESE = 05        SSW = 09        WNW = 0D
  152.     NE = 02            SE = 06         SW = 0A         NW = 0E
  153.    ENE = 03           SSE = 07        WSW = 0B        NNW = 0F
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.